from django.core.cache import cache
from django.contrib.auth.forms import UserCreationForm
from django.views.generic.simple import direct_to_template
from django.http import HttpResponseRedirect
from django.views.generic.simple import direct_to_template

from dolorinfantil2011.forms import RegistrationForm

def registration(request):
    if request.method == 'POST':
        form = RegistrationForm(request.POST)
        if form.is_valid():
            registration = form.save(commit=False)
            return HttpResponseRedirect('/inscripcion')
    else:
        form = RegistrationForm()
    return direct_to_template(request, 'pages/inscripcion.html',
                              {'form': form})
